﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CUIT.GraduationProject.ToolBoxSystem.ToolBoxLib;
using CUIT.GraduationProject.ToolBoxSystem.PropertyLib;

namespace CUIT.GraduationProject.ToolBoxSystem.Platformd
{
    /// <summary>
    ///  平台
    /// </summary>
    public partial class MainPlatform : Form
    {
        public static ToolBox g_tb; // 工具箱
        public static System.Drawing.Rectangle g_FormClientRectangle; // 主界面窗体客户区
        public static PropertyLibForm proForm;

        /// <summary>
        ///  加载
        /// </summary>
        public MainPlatform()
        {
            InitializeComponent();
            InitializeToolBoxLib();
            InitializePropertyLib();

            g_tb = new ToolBox(new Size(200, ClientRectangle.Height - 0), 22, null);
            g_tb.Location = new Point(0, 50);

            //g_tb.SetClickDelegate(new ToolBox.OnToolBoxClick(OnTBClick));
            //g_tb.SetTabChangedDelegate(new ToolBox.OnToolBoxTabChanged(OnTBTabChanged));
            //g_tb.SetStateChangedDelegate(new ToolBox.OnToolBoxStateChanged(OnTBStateChanged));
            g_tb.Show();
            this.Controls.Add(g_tb);
            g_tb.BringToFront();
        }

        /// <summary>
        ///  初始化工具箱
        /// </summary>
        private void InitializeToolBoxLib()
        {
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            this.SizeChanged += new System.EventHandler(this.MainPlatform_SizeChanged);
        }

        /// <summary>
        ///  初始化属性窗口
        /// </summary>
        private void InitializePropertyLib()
        {
            proForm = new PropertyLibForm();
            proForm.Size = new Size(200, ClientRectangle.Height - 0);
            proForm.Location = new Point(1165,50);
            proForm.Show();
            this.Controls.Add(proForm);
            proForm.BringToFront();
        }

        /// <summary>
        ///  窗体大小改变事件
        /// </summary>
        /// <param name="sender">sender</param>
        /// <param name="e">e</param>
        private void MainPlatform_SizeChanged(object sender, EventArgs e)
        {
            g_tb.SetSize(new Size(g_tb.Width, ClientRectangle.Height - 0));
            g_FormClientRectangle = this.ClientRectangle;
            proForm.SetSize(new Size(proForm.Width, ClientRectangle.Height - 0));
        }

        private void Tls_Property_Click(object sender, EventArgs e)
        {

        }

        private void Tls_Cut_Click(object sender, EventArgs e)
        {

        }

        private void Tls_Copy_Click(object sender, EventArgs e)
        {

        }

        private void Tls_Paste_Click(object sender, EventArgs e)
        {

        }

        private void Tls_Repeal_Click(object sender, EventArgs e)
        {

        }

        private void Tls_Save_Click(object sender, EventArgs e)
        {

        }
    }
}
